<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    var a = 10;
    var b = 10;
    var o = {
        a:b
    }
    console.log(o.a);

    var a = 'foo';
    var b = 'bar';
    var o = {
        a:a
    }
    console.log(o);





</script>
</body>
</html>